public class Student2 {
public String name;
public String sex;
public int age;
public double score;
public static String classRoom = "Bit306";
public Student2(String name, String sex, int age, double score){


}
public void print(){
    System.out.println(name+" "+sex+" "+age+" "+score);
}
public static void main(String[] args) {
// 静态成员变量可以直接通过类名访问
System.out.println(Student2.classRoom);
Student2 s1 = new Student2("Li leilei", "男", 18, 3.8);
Student2 s2 = new Student2("Han MeiMei", "女", 19, 4.0);
Student2 s3 = new Student2("Jim", "男", 18, 2.6);
s1.print();
s2.print();
s3.print();
// 也可以通过对象访问：但是classRoom是三个对象共享的
System.out.println(s1.classRoom);
System.out.println(s2.classRoom);
System.out.println(s3.classRoom);
    }
}
/*
public class Student{
    public String name;
    public String gender;
    public int age;
    public double score;
    private static String classRoom = "Bit306";
    // ...
    public static String getClassRoom(){
        return classRoom;
    }
}
public class TestStudent {
    public static void main(String[] args) {
        System.out.println(Student.getClassRoom());
    }
}*/
